import java.util.*;

public class MyDCTest {
    public static void main(String[] args) {
        String expression, again;
        int result;
        MyBC nts = new MyBC();
        MyDC value = new MyDC();
        try {
            System.out.println("Enter a valid postfix expression: ");
            Scanner in = new Scanner(System.in);
            do {
                expression = in.nextLine();
                nts.conversion(expression);
                result = value.evaluate(nts.getMessage());
                System.out.println("That expression equals " + result);
                System.out.print("Evaluate another expression [Y/N]? ");
                again = in.nextLine();
            }
            while (again.equalsIgnoreCase("y"));
        } catch (Exception IOException) {
            System.out.println("Input exception reported");
        }
    }
}